package pro;

/**
 * @Description: TODO
 * @author: muxiongxiong
 * @date: 2021年07月02日 10:29
 * 公众号：雄雄的小课堂
 * 博客：https://blog.csdn.net/qq_34137397
 */
public class Student {

    private int sid;
    private String name;
    private int age;
    private String address;

    public Student(int sid, String name, int age, String address) {
        this.sid = sid;
        this.name = name;
        this.age = age;
        this.address = address;
    }

    public Student() {

    }

    //对编号进行封装（添加get和set方法）
    public int getSid() {
        return this.sid;
    }

    public void setSid(int sid) {
        this.sid = sid;
    }

    //对姓名进行封装
    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    //对年龄进行封装，年龄必须在60-100之间
    public int getAge() {
        return this.age;
    }

    public void setAge(int age) {
        if (age < 60 || age > 100) {
            this.age = 60;
        } else {
            this.age = age;
        }
    }

    //对地址封装
    public String getAddress() {
        return this.address;
    }

    public void setAddress(String address) {
        this.address = address;
    }


}
